﻿using System;

namespace Cms.Domain
{
    public class MasterTemplateStylesheet : IComparable<MasterTemplateStylesheet>
    {
        public virtual int ID { get; set; }

        public virtual MasterTemplate MasterTemplate { get; set; }

        public virtual Stylesheet Stylesheet { get; set; }

        public virtual int SortIndex { get; set; }

        #region IComparable<MasterTemplateStylesheet> Members

        public virtual int CompareTo(MasterTemplateStylesheet other)
        {
            // Null is considered to be smaller than any other value.
            if (other == null)
                return 1;
            if (SortIndex < other.SortIndex)
                return -1;
            return SortIndex == other.SortIndex ? 0 : 1;
        }

        #endregion
    }
}